module(..., package.seeall)

require "utils.oop"


Named = class("Named")

function Named.__init(self, name)
    self.name = name
end

function Named.__tostring(self)
    local info = self.__info
    if info == nil then
        info = ""
    elseif type(info) == "function" then
        info = tostring(info(self))
    else
        info = tostring(info)
    end
    return ("<%s %s(%s)>"):format(self.__name, self.name, info)
end
